package com.zhuangjie.mvc.validator.annotate;

import com.zhuangjie.mvc.validator.handler.ValidNumberEnumsStringValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = ValidNumberEnumsStringValidator.class)
public @interface ValidNumberEnumsString {
    String message() default "{com.yourdomain.validation.constraints.ValidStringPattern.message}";

    /**
     * 1,2,3 中的,分隔符号
     * @return
     */
    String delimiter();

    /**
     * 是否允许负数
     * @return
     */
    boolean allowNegative() default false;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
